###############################################################################
# Makefile for XML sample C files
###############################################################################

# include common definitions
include ../Makefile.defs

PROGS=	DOMNamespace DOMSample FullDOM Traverse XPointer

# make all class files
all: $(PROGS)

DOMSample: DOMSample.c
	$(CC) -o DOMSample $(INCLUDE) $@.c $(LIB)

DOMNamespace: DOMNamespace.c
	$(CC) -o DOMNamespace $(INCLUDE) $@.c $(LIB)

FullDOM: FullDOM.c
	$(CC) -o FullDOM $(INCLUDE) $@.c $(LIB)

Traverse: Traverse.c
	$(CC) -o Traverse $(INCLUDE) $@.c $(LIB)

XPointer: XPointer.c
	$(CC) -o XPointer $(INCLUDE) $@.c $(LIB)

sure: $(PROGS)
	./DOMSample > DOMSample.out
	@if cmp -s DOMSample.out DOMSample.std; then echo PASS; else echo FAIL; fi
	./DOMNamespace > DOMNamespace.out
	@if cmp -s DOMNamespace.out DOMNamespace.std; then echo PASS; else echo FAIL; fi
	./FullDOM > FullDOM.out
	@if cmp -s FullDOM.out FullDOM.std; then echo PASS; else echo FAIL; fi
	./Traverse > Traverse.out
	@if cmp -s Traverse.out Traverse.std; then echo PASS; else echo FAIL; fi
	./XPointer > XPointer.out
	@if cmp -s XPointer.out XPointer.std; then echo PASS; else echo FAIL; fi

clean:
	rm -f $(PROGS) *.o *.out

# end of Makefile
